import sys
sys.path.append('/home/carlan/Pessoal/Projetos/Python/ToDo/')

from model.todo import *
from model.todoDao import *

class Get:    
    def __init__(self):
        print '[LOG] Creating dao class...'
        dao = ToDoDao()
        print '[LOG] Initiallize table todo...'
        dao.initTables()
        print '[LOG] Getting To Do item from database...'
        
        try:
            todoItem = dao.getById(2)
            print '[LOG] Listing some attributes...'
            print ''
            print 'ID: %s' % todoItem.id
            print 'DESCRICAO: %s' % todoItem.descricao
            print 'COMENTARIO: %s' % todoItem.comentario
            print 'DATA: %s' % todoItem.data
            print 'IMPORTANCIA: %s' % todoItem.importancia
        except:
            print 'To Do item not found...'
    
testGet = Get()
